"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stateType = exports.EndNode = exports.RewardNode = exports.FightNode = exports.ChoiceNode = exports.ConvFlowNode = exports.DialogueNode = exports.StartNode = exports.GraphRes = exports.location = exports.end = exports.reward = exports.fight = exports.convFlow = exports.choice = exports.role = exports.PlotCraftRes = void 0;
const uuid_1 = require("uuid");
/***内部资源 */
class PlotCraftRes {
    constructor(PlotCraftRes_Id, PlotCraftRes_Type) {
        this.PlotCraftRes_Id = PlotCraftRes_Id;
        this.PlotCraftRes_Type = PlotCraftRes_Type;
    }
    Create_PlotCraftRes_Id() {
        const newId = (0, uuid_1.v4)();
        return newId;
    }
}
exports.PlotCraftRes = PlotCraftRes;
//角色属性
class role extends PlotCraftRes {
    constructor(role_name, role_id, role_picUrl, role_desc, role_others) {
        super("", 'character'); // 传递正确的参数
        this.role_name = role_name;
        this.role_id = role_id;
        this.role_picUrl = role_picUrl;
        this.role_desc = role_desc;
        this.role_others = role_others;
        this.PlotCraftRes_Id = this.Create_PlotCraftRes_Id();
    }
}
exports.role = role;
//选择
class choice {
    ; //目标节点
    constructor(choice_id, choice_content, choice_target_id = '') {
        this.choice_id = choice_id;
        this.choice_content = choice_content;
        this.choice_target_id = choice_target_id;
    }
}
exports.choice = choice;
//对话流
class convFlow {
    constructor(role_name, role_id, role_pic, convFlow_id, convFlow_content) {
        this.role_name = role_name;
        this.role_id = role_id;
        this.role_pic = role_pic;
        this.convFlow_id = convFlow_id;
        this.convFlow_content = convFlow_content;
    }
}
exports.convFlow = convFlow;
//战斗
class fight {
    constructor(fight_id, fight_name) {
        this.fight_id = fight_id;
        this.fight_name = fight_name;
    }
}
exports.fight = fight;
//奖励
class reward {
    constructor(reward_name, reward_id, reward_desc, reward_value) {
        this.reward_name = reward_name;
        this.reward_id = reward_id;
        this.reward_desc = reward_desc;
        this.reward_value = reward_value;
    }
}
exports.reward = reward;
//结束
class end {
    constructor(end_content) {
        this.end_content = end_content;
    }
}
exports.end = end;
//地点属性
class location extends PlotCraftRes {
    constructor(location_name, location_id, location_picUrl, location_desc, location_others) {
        super("", 'location'); // 传递正确的参数
        this.location_name = location_name;
        this.location_id = location_id;
        this.location_picUrl = location_picUrl;
        this.location_desc = location_desc;
        this.location_others = location_others;
        this.PlotCraftRes_Id = this.Create_PlotCraftRes_Id();
    }
}
exports.location = location;
/***图资源 */
class GraphRes {
    constructor(graphRes_title, graphRes_id, graphRes_type) {
        this.graphRes_title = graphRes_title;
        this.graphRes_id = graphRes_id;
        this.graphRes_type = graphRes_type;
    }
    static getNextId() {
        return GraphRes.lastId++;
    }
}
exports.GraphRes = GraphRes;
GraphRes.lastId = 0; // 静态属性用于跟踪上一个分配的ID
//开始节点
class StartNode extends GraphRes {
    constructor(startName, startID) {
        super('未命名开始', 0, '开始'); // 传递正确的参数
        this.startName = startName;
        this.startID = startID;
    }
}
exports.StartNode = StartNode;
//对话节点
class DialogueNode extends GraphRes {
    constructor(rolePos, rolePic, roleName, roleID, locationName, locationID, locationPic, content) {
        super('未命名对话', GraphRes.getNextId(), '对话'); // 传递正确的参数
        this.rolePos = rolePos;
        this.rolePic = rolePic;
        this.roleName = roleName;
        this.roleID = roleID;
        this.locationName = locationName;
        this.locationID = locationID;
        this.locationPic = locationPic;
        this.content = content;
    }
}
exports.DialogueNode = DialogueNode;
//对话流节点
class ConvFlowNode extends GraphRes {
    constructor(rolePos = false, currentConvFlow = new convFlow('', '', '', -1, ''), locationName = '', locationID = '', locationPic = '', convFlowList) {
        let newId = GraphRes.getNextId();
        super('未命名对话流', newId, '对话流'); // 传递正确的参数
        this.rolePos = rolePos;
        this.currentConvFlow = currentConvFlow;
        this.locationName = locationName;
        this.locationID = locationID;
        this.locationPic = locationPic;
        this.convFlowList = this.initConvFlowList(newId);
    }
    initConvFlowList(initID) {
        let newConvFlowList = [];
        let newChoice = new convFlow('', '', '', initID, 'Content...');
        newConvFlowList.push(newChoice);
        return newConvFlowList;
    }
}
exports.ConvFlowNode = ConvFlowNode;
//选择节点
class ChoiceNode extends GraphRes {
    constructor(choiceList) {
        let newId = GraphRes.getNextId();
        super('未命名选择', newId, '选择'); // 传递正确的参数
        this.choiceList = this.initChoiceList(newId);
    }
    initChoiceList(newId) {
        let newChoice = new choice(newId, 'A');
        let newChoiceList = [];
        newChoiceList.push(newChoice);
        return newChoiceList;
    }
}
exports.ChoiceNode = ChoiceNode;
//战斗节点
class FightNode extends GraphRes {
    constructor(fightList, failSkipID = -1, winSkipID = -1) {
        super('未命名战斗', GraphRes.getNextId(), '战斗'); // 传递正确的参数
        this.failSkipID = failSkipID;
        this.winSkipID = winSkipID;
        this.fightList = this.initFightList();
    }
    initFightList() {
        let initList = ['请输入npcID'];
        let newFightList = [];
        initList.forEach(element => {
            const newFight = new fight(element, '');
            newFightList.push(newFight);
        });
        return newFightList;
    }
}
exports.FightNode = FightNode;
//奖励节点
class RewardNode extends GraphRes {
    constructor(rewardList) {
        super('未命名选择', 0, '奖励'); // 传递正确的参数
        this.rewardList = rewardList;
    }
}
exports.RewardNode = RewardNode;
//结束节点
class EndNode extends GraphRes {
    constructor(endContent = '') {
        super('未命名结束', GraphRes.getNextId(), '结束'); // 传递正确的参数
        this.endContent = endContent;
    }
}
exports.EndNode = EndNode;
//当前节点状态
var stateType;
(function (stateType) {
    stateType[stateType["default"] = 0] = "default";
    stateType[stateType["start"] = 1] = "start";
    stateType[stateType["dialogue"] = 2] = "dialogue";
    stateType[stateType["convFlow"] = 3] = "convFlow";
    stateType[stateType["choice"] = 4] = "choice";
    stateType[stateType["fight"] = 5] = "fight";
    stateType[stateType["reward"] = 6] = "reward";
    stateType[stateType["end"] = 7] = "end";
})(stateType = exports.stateType || (exports.stateType = {}));
